package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 87111
 * Date: 2025-06-23
 * Time: 22:02
 */
public class Test {
    public static void main(String[] args) {
        Outer01 outer01 = new Outer01();
        outer01.print();
    }
}

class Outer01 {
    public int a = 10;
    public void print() {

        IA dog = new IA() {
            public void cry() {
                System.out.println("小狗在汪汪叫");
            }
        };
        dog.cry();
    }
}

interface IA {
    public void cry();
}

//class Dog implements IA {
//    public void cry() {
//        System.out.println("小狗在汪汪叫");
//    }
//}


